'use strict';
const { Service } = require('egg');

class UserService extends Service {
  async getName(id) {
    const { ctx } = this;
    const user = await ctx.model.User.findByPk(id);
    if (!user) return null;

    return user.name;
  }
}

module.exports = UserService;
